#ifndef QS_RF_PROTOCOL_H_
#define QS_RF_PROTOCOL_H_
#include "qs_config.h"
#include "LT8960Ldrv.h"
#pragma pack(1)
typedef union {
  struct {
      uint8_t len;
      uint8_t type;
      uint8_t data[1];
  };
  struct {
      uint8_t len;
      uint8_t type;
      uint8_t mac[6];
      uint8_t value;
  }keys;
  struct {
      uint8_t len;
      uint8_t type;
      
      uint8_t work_mode;
      uint8_t auto_mode;
      uint8_t fan_level;
      uint8_t heat_level;
      uint16_t timer;
      uint8_t value;
      uint8_t uid[4];
      uint8_t rc_uid[4];
      uint8_t temp0;
      uint8_t humid0;
      uint8_t temp1;
      uint8_t humid1;
  }status;
  uint8_t daten[Packet_Length - 1];
}qs_rf_protocol_t;



#pragma pack()

typedef void (*qs_rf_protocol_on_tx_ready_handle_s)(void);
typedef void (*qs_rf_protocol_on_tx_payload_ack_handle_s)(qs_rf_protocol_t* p_frame);
typedef void (*qs_rf_protocol_on_rx_data_handle_s)(qs_rf_protocol_t* p_frame);
typedef enum {
    RF_TX_MODE,
    RF_TX_ACK_SET_MODE,
    RF_TX_ACK_MODE,
    RF_RX_MODE,
    RF_RX_ACK_MODE,
    RF_SINGLE_CARRIER_MODE,
    RF_SLEEP_AWAKE_MDOE,
}qs_rf_work_mode_t;    





void rf_protocol_tx_mode_data_send(qs_rf_protocol_t* p_frame);
void rf_protocol_tx_ack_payload_data_send(qs_rf_protocol_t* p_frame);
qs_ret_code_t qs_rf_protocol_init(qs_rf_work_mode_t mode);

void qs_rf_protocol_tx_mode_event_handle_set(qs_rf_protocol_on_tx_ready_handle_s on_tx_ready, qs_rf_protocol_on_tx_payload_ack_handle_s on_tx_payload_ack);
void qs_rf_protocol_rx_mode_event_handle_set(qs_rf_protocol_on_rx_data_handle_s on_rx_data);
#endif